<template>
		
	<div>
		<block v-if="showLive">
			<web-view src="http://49.4.68.157/mobile.html?roomid=265A6AC827B93A509C33DC5901307461&userid=600FDEA7CAFDC216"></web-view>
		</block>
		<block v-else>
			showLiveshowLive
		</block>
		<!-- <div class="live" style="">
			<img src="" alt="">
		</div>
		<wuc-tab :tab-list="tabList" textFlex :tabCur.sync="TabCur" tab-class="text-center text-black bg-white"
		 select-class="text-white bg-orange" @change="tabChange"></wuc-tab>
		 
		<div class="padding  text-center text-black" >
			<zhiyi-answer :dataObj="answerData" v-show="curType=='zhiyi-answer'"></zhiyi-answer>
			<zhiyi-pending-approval :dataObj="answerData" v-show="curType=='zhiyi-pending-approval'"></zhiyi-pending-approval>
			<zhiyi-white-broad v-show="curType=='zhiyi-white-broad'"></zhiyi-white-broad>
			<zhiyi-solution v-show="curType=='zhiyi-solution'"></zhiyi-solution>
			<zhiyi-interaction v-show="curType=='zhiyi-interaction'"></zhiyi-interaction>
			
		</div> -->
	</div>
</template>
<script>
	import WucTab from '@/components/wuc-tab/wuc-tab.vue';
	import ZhiyiAnswer from '@/components-zhiyi/zhiyi-answer/zhiyi-answer.vue';
	import ZhiyiPendingApproval from '@/components-zhiyi/zhiyi-pending-approval/zhiyi-pending-approval.vue';
	import ZhiyiWhiteBroad from '@/components-zhiyi/zhiyi-white-broad/zhiyi-white-broad.vue';
	import ZhiyiSolution from '@/components-zhiyi/zhiyi-solution/zhiyi-solution.vue';
	import ZhiyiInteraction from '@/components-zhiyi/zhiyi-interaction/zhiyi-interaction.vue';
	import subjectiveLiveApi from '@/api/subjectiveLive.js'
	let _this
	export default {
		components: {
			WucTab,
			ZhiyiAnswer,ZhiyiPendingApproval,ZhiyiWhiteBroad,ZhiyiSolution,ZhiyiInteraction
		},
		onLoad(query) {
			_this = this;
			_this.initData(query)
		},
		data() {
			return {
				showLive:false,
				tabList: [{
						name: '答题',
						type:'zhiyi-answer',
						// icon: 'cuIcon-comment'
					},
					{
						name: '待批',
						type:'zhiyi-pending-approval',
						// icon: 'cuIcon-dianhua',
						disabled:true
					},
					{
						name: '白板',
						type:'zhiyi-white-broad',
						// icon: 'cuIcon-wifi'
					},
					{
						name: '答案', 
						type:'zhiyi-solution',
						// icon: 'cuIcon-wifi'
					},
					{
						name: '互动',
						type:'zhiyi-interaction',
						// icon: 'cuIcon-wifi'
					},
					
				],
				TabCur:0,
				curType:'zhiyi-answer',
				answerData:{
					countDown:{
						hour:0,
						minute:0,
						second:5,
						startCountDown:false
					}
				}
			};
		},

		

		computed: {
		
		},

		methods: {
			initData(query){
				subjectiveLiveApi.zgzbInfo(query).then(res=>{
					console.log(res)
					_this.showLive = true
				}).catch(err=>{
					_this.showLive = false
					console.log(err)
					uni.showToast({
						icon:'none',
						title:err.msg
					})
				})
			},
			tabChange(index) {
			    this.TabCur = index;
				// console.log(this.TabCur)
				this.curType = this.tabList[index].type
				this.tabList[1].disabled=false
				// console.log(this.tabList)
				this.answerData.countDown.startCountDown=true
			},
		},

		onReady() {}
	};
</script>
<style>

	div,
	scroll-view,
	swiper {
		box-sizing: border-box;
	}

	div {
		font-size: 28upx;
		background-color: #f1f1f1;
	}
	.live{
		width: 100%;
		height: 500upx;
	}
	.swiper {
		height: 140upx;
	}

	.cu-bar {
		display: flex;
		position: relative;
		align-items: center;
		min-height: 100upx;
		justify-content: space-between;
	}

	.cu-bar .action {
		display: flex;
		align-items: center;
		height: 100%;
		justify-content: center;
		max-width: 100%;
		background-color: #ffffff;
	}

	.cu-bar .action:first-child {
		margin-left: 30upx;
		font-size: 30upx;
	}

	.solid,
	.solid-bottom {
		position: relative;
	}

	.solid::after,
	.solid-bottom::after {
		content: " ";
		width: 200%;
		height: 200%;
		position: absolute;
		top: 0;
		left: 0;
		border-radius: inherit;
		transform: scale(0.5);
		transform-origin: 0 0;
		pointer-events: none;
		box-sizing: border-box;
	}

	.solid::after {
		border: 1upx solid rgba(0, 0, 0, 0.1);
	}

	.solid-bottom::after {
		border-bottom: 1upx solid rgba(0, 0, 0, 0.1);
	}

	.text-orange {
		color: #f37b1d
	}
	.text-white  {
		color: #ffffff
	}
	.text-black {
		color: #333333;
	}

	.bg-white {
		background-color: #ffffff;
	}
	.bg-orange{
		background-color: #f37b1d;
	}

	.padding {
		padding: 30upx;
	}

	.margin {
		margin: 30upx;
	}

	.margin-top {
		margin-top: 30upx;
	}

	.text-center {
		text-align: center;
	}
</style>
